import {defineConfig} from 'vite';
//@ts-ignore
import JsxModelTransform from 'plain-design-composition/plugins/vite-plugin-react-jsx-model';
import react from '@vitejs/plugin-react';
import path from 'path';

const resolve = (filePath: string) => path.resolve(__dirname, './', filePath);

// https://vitejs.dev/config/
export default defineConfig({
  base: '/react-x6-editor/',
  resolve: {
    alias: {
      '@antv/x6': resolve('build/antvx6/antvx6.js')
    }
  },
  build: {
    outDir: 'react-x6-editor',
    rollupOptions: {
      input: {
        main: resolve('index.html'),
      }
    },
  },
  plugins: [react(), JsxModelTransform()],
});
